<style>
.mod-group {
    margin: 0 auto;
	margin-top: 5px;
    width: 94%;
    background-color: #fff;
    border-radius: 10px;
    border: 1px solid #f2f2f2;
}
.fui-icon-group .fui-icon-col-sm {
    margin:10px 0;
}
.badge {
    left: 2rem;
    top: 0;
}
</style>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='main'">
    <div class="fui-header">
		<div class="fui-header-left" onclick="window.history.go(-1);">
            <a class="back"></a>
        </div>
		<div class="title">会员中心</div>
		<div class="fui-header-right"></div>
	</div>
	<div class='fui-content member-page' style="top:0;background:#f2f5fc">
		<div style="top:0;background: linear-gradient(to bottom, #f8dfd8, #f2f5fc);">
		<div class="bottombg" style="padding:1rem 0.7rem;padding-bottom:0.2rem;">
			<div class="bold" style="font-size:1rem">{{pagedata.showdaytypetitle}}好，</div>
			<div class="fui-page-desc gray">{{pagedata.pluginset.homedesc||'从今天起做自己健康第一责任人'}}</div>
		</div>
		<div class="bottombg" style="padding:0.5rem;padding-bottom:0">
			<div class="fui-cellone" style="background: linear-gradient(to right, #fef6f4, #edf6fd);border-radius:0.5rem;align-items:stretch">
				<div class="fui-cellone-text">
					<div class="bold" style="width:100%;font-size:1rem">{{pagedata.member.nickname}}</div>
					<div class="gray" style="font-size:0.6rem">
						<div style="width:100%;font-size:0.6rem" href="javascript:;" ng-click="pagedata.showinfo=true">{{pagedata.member.sextitle||'*'}} {{pagedata.member.mobile}} <span style="color:{{main.syscolor || '#4491F1'}}">设置</span></div>
						<div class="" ng-if="pagedata.basic.no_vip !=1 && pagedata.user.isvip==1 && pagedata.user.vipstatus ==1" href="javascript:;" ng-click="access_json('jy_aixiaoyi/home/buyvip/')">
							VIP到期时间:{{pagedata.user.viptime}} 
							<span class="label label-success"> 续费VIP</span>
						</div>
						<div class="" ng-if="pagedata.basic.no_vip !=1 && pagedata.user.isvip==1 && pagedata.user.vipstatus ==2" href="javascript:;" ng-click="access_json('jy_aixiaoyi/home/buyvip/')">
							VIP已过期 <span class="label label-success">续费VIP</span>
						</div>
						<div class="" ng-if="pagedata.basic.no_vip !=1 && pagedata.user.isvip!=1" href="javascript:;" ng-click="access_json('jy_aixiaoyi/home/buyvip/')">
							<span class="label label-success" style="">购买VIP</span>
						</div>
					</div>
					<div class="gray" style="padding-top:0.3rem">
						<span class="label label-success" href="javascript:;" ng-click="access_json('jy_aixiaoyi/myjiankang/')" style="background:#dcf4f4;color:#00b7a3;padding:0.3rem"><i class="icon icon-follow" style="font-size:0.65rem"></i> 健康概览</span>
					</div>
				</div>
				<img ng-if="pagedata.member.sex!=2" src="../addons/jy_aixiaoyi/resource/images/nan.png" style="width: 6rem;position: absolute;bottom:0;right:0"/>
				<img ng-if="pagedata.member.sex==2" src="../addons/jy_aixiaoyi/resource/images/nv.png" style="width: 6rem;position: absolute;bottom:0;right:0"/>
			</div>
		</div>
		</div>
		<div class="fui-icon-group noborder  col-4">
												<div class="fui-icon-col-sm external" style="margin:0">
													<div href="javascript:;" ng-click="access_json('core/member.recharge/')">
														<div class="text bold">{{pagedata.member2.credit2 || '0.00'}}</div>
														<div class="subtitle" style="font-size:12px;color: #666;">余额 <span style="color:{{main.syscolor || '#4491F1'}}">充值</span></div>
													</div>
												</div>
												<div class="fui-icon-col-sm external" style="margin:0">
													<div href="javascript:;" ng-click="access_json('core/member.xunibi//type=1')">
														<div class="text bold">{{pagedata.member2.credit1 || '0'}}</div>
														<div class="subtitle" style="font-size:12px;color: #666;">我的积分</div>
													</div>
												</div>
												<div class="fui-icon-col-sm external" style="margin:0">
													<div href="javascript:;" ng-click="access_json('jy_aixiaoyi/recharge/')">
														<div class="text bold">{{pagedata.member2.credit3 || '0.00'}}</div>
														<div class="subtitle" style="font-size:12px;color: #666;">金币 <span style="color:{{main.syscolor || '#4491F1'}}">充值</span></div>
													</div>
												</div>
												<div class="fui-icon-col-sm external" style="margin:0">
													<div>
														<div class="text bold">{{pagedata.member2.mycoupon || 0}}</div>
														<div class="subtitle" style="font-size:12px;color: #666;">优惠券</div>
													</div>
												</div>
												
		</div>
		<div style="padding:0.5rem">
		<div class="fui-cell-group fui-cell-click " style="margin-top:0;border-radius:0.5rem;" > 
				<a ng-repeat="item in pagedata.pluginset.homenav" class="fui-cell"  href="javascript:;" ng-click="access_json(item.action)">
					<div class="fui-cell-icon"><i class="icon {{item.icon}}"></i></div>
					<div class="fui-cell-text"><p>{{item.title}}</p></div>
					<div class="fui-cell-remark"></div>
				</a>
		</div>
		<div ng-if="pagedata.guwen.id>0" class="fui-cell-group fui-cell-click " style="margin-top:0.5rem;border-radius:0.5rem;" > 
				<a class="fui-cell"  href="javascript:;" ng-click="access_json('jy_aixiaoyi/guwen.index/')">
					<div class="fui-cell-icon"><i class="icon icon-kefuyouxian"></i></div>
					<div class="fui-cell-text"><p>顾问入口</p></div>
					<div class="fui-cell-remark"></div>
				</a>
		</div>
		</div>
		<div ng-include="sys_html('common/_copyright',true)"></div>
	</div>
</div>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='buyvip'">
<div class="fui-content">
		<div class="fui-picture">
				<a style="display: block; padding: {paddingtop}px {paddingleft}px;" data-nocache="true">
					<img ng-src="{{tomedia(pagedata.vipbg) || '../core/resource/images/nopic.jpg'}}">
				</a>
		</div>
		<div class="fui-cell-group fui-cell-click" style="padding-bottom:0.3rem;margin-top:0">
			<div class="fui-cell">
				<div class="fui-cell-label" style='width:auto' >付费方式</div>
				<div class="fui-cell-text"> <span ng-click="pagedata.type(1);" ng-class="{'jylabel jylabel-red':1,'active':pagedata.post.paytype==1}" style="margin-right:10px">按月支付</span><span ng-click="pagedata.type(2);" ng-class="{'jylabel jylabel-red':1,'active':pagedata.post.paytype==2}" style="margin-right:10px">按季支付</span><span ng-click="pagedata.type(3);" ng-class="{'jylabel jylabel-red':1,'active':pagedata.post.paytype==3}">按年支付</span></div>
			</div>
			<div class="fui-cell">
				<div class="fui-cell-label" style='width:auto' >开通时长</div>
				<div class="fui-cell-mask noremark" style="margin-right:10px">
					 <div class="fui-number">
						<div class="minus" ng-click="pagedata.minus(pagedata.post.paytype)">-</div>
						<input class="num" type="tel" name="" value="{{pagedata.post.num}}" readonly="readonly"/>
						<div class="plus" ng-click="pagedata.plus(pagedata.post.paytype)">+</div>
					</div>
				</div>
				<div ng-if="pagedata.post.paytype==1" class="fui-cell-text">个月</div><div ng-if="pagedata.post.paytype==2"  class="fui-cell-text" >个季度</div><div ng-if="pagedata.post.paytype==3" class="fui-cell-text">年</div>
			</div>
			<div class="fui-cell">
				<div class="fui-cell-label" style='width:auto' >费用合计：</div>
				<div class="fui-cell-text bold" style="color:red"> ￥{{pagedata.fee || '0.00'}} <span class="delete">原价:￥{{pagedata.fee0}}</span></div>
			</div>
			</div>
		<div class="weui_cells_checkbox" style="margin-top:2rem">
                <div class="fui-cell-label" style="text-align:center;margin:0 auto;padding:0.2rem">
                    <input type="checkbox" class="fui fui-checkbox fui-checkbox-danger verify-checkbox" style="line-height:0.6rem" ng-checked="pagedata.post.checked==true" ng-model="pagedata.post.checked">
					我已阅读并同意《<a onclick="$('#showsystemcontent').modal();" style="color:f60">会员协议</a>》
                </div>
        </div>
		<div class="weui_btn_area" style="margin-top:0">
			 <a class="weui_btn weui_btn_primary" href="javascript:" id="showTooltips" ng-click="pagedata.buyvip();">提交</a>
		</div>
</div>
<div id="showsystemcontent" class="modal fade" tabindex="-1" style="z-index:99999;display:none;">
<div class="modal-dialog" style="width:96%;left:2%;top:1.5%;">
<div class="modal-content" style="min-height:500px">
	<div aria-hidden="true" data-dismiss="modal" class="closebtn" style="right:10px;top:0"><i class="icon jinyunicon icon-wrong" style="color:#ccc;"></i></div>
	<div class="fui-article-page">
			<div class="fui-article-title" style="text-align:center">平台声明</div>
			<div class="fui-article-content" ng-bind-html="trust(pagedata.basic.systemcontent)"></div>
	</div>
</div>
</div>
</div>
<script type="text/javascript">
//购买
scope.pagedata.buyvip=function(){
	if(!scope.pagedata.post.checked){
		scope.message('请先阅读并勾选《会员协议》','error');
		return false;
	}
	var params={
		data:{'num':scope.pagedata.post.num,'paytype':scope.pagedata.post.paytype},
		op:'buyvip',
		callback:function(res){
			if(res.payid){
				scope.tool.pay(res.payid,function(res){
					if(res.type=='success'){
						scope.message('支付成功！','success','/home/');
					}else{
						scope.message('支付失败！','success','/home/');
					}
				},'','','/home/','/home/');
			}
		}
	};
	scope.post_json(params);
	return
}
//减少
scope.pagedata.minus=function(type){
	if(scope.pagedata.post.num <=1){
		return false;
	}
	scope.pagedata.post.num--;
	scope.pagedata.jisuan(type,scope.pagedata.post.num);
	return
}
//增加
scope.pagedata.plus=function(type){
	scope.pagedata.post.num++;
	scope.pagedata.jisuan(type,scope.pagedata.post.num);
	return
}
//选择付款类型
scope.pagedata.type=function(type){
	scope.pagedata.post.num=1
	scope.pagedata.post.paytype = type;
	scope.pagedata.jisuan(type,scope.pagedata.post.num);
	return
}
//计算
scope.pagedata.jisuan=function(type,num){
	if(type ==1){
		scope.pagedata.basic.mfee=scope.pagedata.basic.mfee?scope.pagedata.basic.mfee:0
		scope.pagedata.basic.mfee0=scope.pagedata.basic.mfee0?scope.pagedata.basic.mfee0:0
		scope.pagedata.fee = getprice(scope.pagedata.basic.mfee * num)
		if(scope.pagedata.basic.mfee0){
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.mfee0 * num)
		}else{
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.mfee * 1.5 * num)
		}
	}else if(type ==2){
		scope.pagedata.basic.jfee=scope.pagedata.basic.jfee?scope.pagedata.basic.jfee:0
		scope.pagedata.basic.jfee0=scope.pagedata.basic.jfee0?scope.pagedata.basic.jfee0:0
		scope.pagedata.fee = getprice(scope.pagedata.basic.jfee * num)
		if(scope.pagedata.basic.jfee0){
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.jfee0 * num)
		}else{
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.jfee * 1.5 * num)
		}
		
	}else if(type ==3){
		scope.pagedata.basic.yfee=scope.pagedata.basic.yfee?scope.pagedata.basic.yfee:0
		scope.pagedata.basic.yfee0=scope.pagedata.basic.yfee0?scope.pagedata.basic.yfee0:0
		scope.pagedata.fee = getprice(scope.pagedata.basic.yfee * num)
		if(scope.pagedata.basic.yfee0){
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.yfee0 * num)
		}else{
			scope.pagedata.fee0 = getprice(scope.pagedata.basic.yfee * 1.5 * num)
		}
	}
	scope.$evalAsync();
}
function getprice(num)
{
	//var num = parseFloat(num);
	num = num.toFixed(2);
	//console.log(num);
	return num
	
}
</script>
</div>
<div class='fui-page fui-page-current' ng-if="pagedata.op=='viplog'">
<div class="fui-content" style="margin-bottom:4.8rem">
	<div class="jy-content">
		<div class="fui-cell-group fui-comment-group" ng-repeat="item in pagedata.list">	
				<div class="fui-cell">
					<div class="fui-cell-text">
						<div class="text bold" style="font-size:0.65rem;color:#5c5c5c">{{item.fee}}元</div>
						<div class="gray" style="font-size:0.55rem">{{item.createtime}}</div>
					</div>
					<div class="fui-cell-remark noremark">
						<span class="red">{{item.ispay}}</span>
					</div>
				</div>
				<div ng-if="!pagedata.loading && (!pagedata.list || pagedata.list.length<1)" class='content-empty' style="margin-top:0">
					<i class='icon icon-cry' style="font-size:1.5rem"></i><br/>暂时没有任何信息
				</div>
		</div>
		<div ng-show="pagedata.loading" class='infinite-loading'><span class='fui-preloader'></span><span style="margin-left:1.5rem"> 正在加载...</span></div>
		<div ng-include="sys_html('common/_copyright',true)"></div>
	</div>
</div>
<script>
	scope.tool.get_list('jy_aixiaoyi/home/viplog/',true);
	scope.pagedata.scroll_bottom=function(){
		scope.tool.get_list('jy_aixiaoyi/home/viplog/');
	}
</script>
</div>
<div ng-if="pagedata.showrecharge" class="popup">
	<div class="popup-body">
		<div class="popup-center" style="background:#fc6d60">
			<style>
				input{ caret-color: #fff;}
				.fui-cell-group .fui-cell .fui-cell-info  ::-webkit-input-placeholder{
					color: #fff
				}
				.fui-cell-group .fui-cell .fui-cell-info {
					font-size: 0.85rem;
					color: #fff;
				}
			</style>
			<i class="closed icon icon-cuowu" ng-click="pagedata.showrecharge=false"></i>
			 <div class='fui-cell-group fui-cell-group-o' style="margin:0.5rem 1rem;padding-top:0.5rem;background:#fc6d60">
				<div class='fui-cell-title c' style="color:#fff">您正在进行【{{pagedata.typetitle || '金币'}}】充值操作
				</div>
				<div class='fui-cell'>
					<div class='fui-cell-label big' style='width:auto;color:#fff'><i class="icon icon-dixiaofei" style="font-size:0.8rem"></i></div>
					<div class='fui-cell-info'>
					<input type='text' class='fui-input' placeholder="充值额度" ng-change="pagedata.upfee()" ng-model="pagedata.post.jifen">
					</div>
				</div>
			</div>
			<div class="weui_btn_area" style="margin:2rem;">
				<div class="c" style="font-size:0.6rem;margin-top:-0.3rem;color:#fff">
						需支付：￥{{pagedata.post.fee || 0}} （充值比例：{{pagedata.bi_rate}}比1）						
				</div>
				<a class='weui_btn weui_btn_primary' style="border-radius:1rem;background-color:#fff;color:#fc6d60" ng-click="pagedata.recharge()">确认充值</a>
			</div>
		</div>
	</div>
	<script>
	scope.pagedata.upfee=function(){
		scope.pagedata.post.fee=(scope.pagedata.post.jifen/scope.pagedata.bi_rate).toFixed(2);
	}
	scope.pagedata.recharge=function(){
		scope.pagedata.post.type=3
		scope.post_json('jy_aixiaoyi/home/recharge/',scope.pagedata.post,function(pay_id){
			var success_url='/home//type='+scope.pagedata.post.type;
			scope.tool.pay(pay_id,function(res){
					if(res.type=='success'){
						scope.message('支付成功！','success',success_url);
					}else{
						scope.message('支付失败！','success',success_url);
					}
			},'','',success_url,success_url);
		});
	}
	</script>
</div>
<div ng-include="sys_html('_footer')"></div>